import React, { PureComponent } from 'react'
import { Modal, Steps, Empty } from 'antd'
import PropTypes from 'prop-types'

// import Style from './logisticsModal.css'

const { Step } = Steps

class logisticsModal extends PureComponent {
  static propTypes = {
    visible: PropTypes.bool,
    onOk: PropTypes.func,
    onCancel: PropTypes.func,
    logisticsList: PropTypes.array
  }

  constructor (props) {
    super(props)
    this.state = {
    }
  }

  render () {
    const { visible, onCancel, logisticsList = [] } = this.props
    return (
      <Modal
        title='订单跟踪'
        width='750px'
        visible={visible}
        onOk={onCancel}
        onCancel={onCancel}
      >
        {logisticsList && logisticsList.length ? (
          <Steps progressDot current={0} direction='vertical'>
            {logisticsList.map(n => <Step title={n.logisticsNode} description={n.logisticsTime} />) }
          </Steps>
        ) : <Empty />}
      </Modal>
    )
  }
}

export default logisticsModal
